Support horizontal scrolling (hold shift)#2432
Support horizontal scrolling (hold shift)#2432towerofnix wants to merge 2 commits intojmoenig:masterfrom towerofnix:horiz-scroll
Conversation
Also makes use of the standardized 'wheel' event, instead of non-standard/obsolete alternatives.
|
Well I certainly like that this adds features while reducing code. :) Minor thing but do you have a link to the reasons for the multiplier values? |
There's no hard resource explaining it, but there's some discussion in scratchfoundation/scratch-blocks#1190. In actuality we were already basically doing this math in the existing Snap! code - note we were dividing by 120 or 3 depending on if the event was from Chrome or Firefox. The point is just to adjust the value to a range that Snap! is roughly expecting, instead of some really giant value like 50, which would result in a very big scroll distance. :P |
|
Thank you! |
|
No problem! 🎉 |
|
Sorry for the delay, tested and test seems fine on a Mac with a trackpad. |
|
No worries! Thanks for the review. I made the fix you suggested (plus a semicolon missing from your suggested changes :P). |
|
Good catch. 👀 |
cycomachead
left a comment
There was a problem hiding this comment.
This seems good to me. :)
This PR makes Snap! scroll elements horizontally when you hold shift - it's a standard interaction in almost all desktop and web apps. It also make it so Snap! uses the standardized
'wheel'event, instead of non-standard/obsolete alternatives.In actuality, this PR is extremely similar to one I made for Scratch 3.0: scratchfoundation/scratch-blocks#1670.
Tested in Firefox and Chromium! Definitely worth checking on a device with a trackpad (i.e. a macbook) before merging; I haven't got access to one ATM, so I haven't tried myself.
Relevant forum thread: https://forum.snap.berkeley.edu/t/holding-shift-while-scrolling-should-scroll-horizontally/604/3
/cc @cycomachead!